{% extends "EMNewsBundle::layout.html.twig" %}
{% block title 'News - Categories list' %}
{% block scripts%}    

{% endblock%}
{% block middlenav%}
 
<div class="middleNav">
    	<ul>
        	<li class="iNew"><a href="#" id="new_btn" title=""><span>Add New</span></a></li>
		</ul>
    </div>
{% endblock%}
{% block content %}
<div class="widgets" id="formcontent">
 {% include 'EMNewsBundle:Category:_new.html.twig' %}
</div>
<script>
$("#new_btn").click(function(event){
                    
                        $.ajax({type: 'get', url:'{{path('em_category')}}', script:true, cache:false,
                        beforeSend: function(response){ $('#loading').append('<div class="loader"><img src="{{asset('bundles/news/images/loaders/loader.gif')}}" alt=""></div>');},
                        error: function(){ $('#formcontent').html('<div class="nNote nFailure hideit"><p><strong>FAILURE: </strong>Oops sorry. That action is not valid, or our servers have gone bonkers</p></div>');},
                        success: function(response) {
                                 if (response === "false"){

                                 }else
                                 {
                                
                                    $('#formcontent').html(response);

                                 }
                         } });
                   
                      return false;
                              
});
</script>   
{% endblock %}
   
